POV-Ray : Newsgroups : povray.beta-test : Raising Negative Numbers to a Power : Re: Raising Negative Numbers to a Power Server Time
30 Jul 2024 20:30:21 EDT (-0400)
  Re: Raising Negative Numbers to a Power  
From: Tor Olav Kristensen
Date: 2 Oct 2001 17:49:48
Message: <3BBA3674.67833A0C@hotmail.com>
Mark Wagner wrote:
> 
> Josh Seagoe wrote in message <3BB### [at] smileyfacecom>...
> >Ok, more specific about what I posted about SuperTorus...
> >
> >This:
> >#declare K=function(v,p) { (v^p)^(1/p) }
> >
> >#debug concat(str(K(1,3), 2, 4), "\n")
> >#debug concat(str(K(.1,3), 2, 4), "\n")
> >#debug concat(str(K(-1,3), 2, 4), "\n")
> >#debug concat(str(K(-.1,3), 2, 4), "\n")
> 
> Computers can't do exact representations of many fractions, so instead of
> trying to guess whether 0.33333333 is supposed to represent 1/3 or not, most
> computers simply reject the notion of raising negative numbers to
> non-integer powers.
> 
> Try using the Windows calculator program to evaluate these.  It's not a
> shortcoming in POV-Ray, it's a shortcoming of almost every computer in the
> world.

My very cheap little Casio fx-82 can do these correctly:

1 +/- ^ 3 = ^ 3 1/x =
Result: -1

0.1 +/- ^ 3 = ^ 3 1/x = 
Result: -0.1


Tor Olav


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.